﻿''' <summary>
''' POST/PLOT FILE OF CONCURRENT
''' </summary>
''' <remarks></remarks>
Public Class Concurrent
    Private m_X As Double 'X坐标
    Private m_Y As Double 'Y坐标
    Private m_CONC As Double '平均浓度
    Private m_ZELEV As Double
    Private m_ZHILL As Double
    Private m_ZFLAG As Double
    Private m_AVE As String
    Private m_GRP As String
    Private m_DATET As String
    Private m_NET_ID As String

    ''' <summary>
    ''' 用于存储读取到的数据
    ''' </summary>
    ''' <remarks></remarks>
    Private m_ConcurrentCollection As New List(Of Concurrent)

    ''' <summary>
    ''' X坐标
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property X() As Double
        Get
            Return Me.m_X
        End Get
        Set(ByVal value As Double)
            Me.m_X = value
        End Set
    End Property
    ''' <summary>
    ''' Y坐标
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property Y() As Double
        Get
            Return Me.m_Y
        End Get
        Set(ByVal value As Double)
            Me.m_Y = value
        End Set
    End Property
    ''' <summary>
    ''' 平均浓度
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property CONC() As Double
        Get
            Return Me.m_CONC
        End Get
        Set(ByVal value As Double)
            Me.m_CONC = value
        End Set
    End Property
    Property ZELEV() As Double
        Get
            Return Me.m_ZELEV
        End Get
        Set(ByVal value As Double)
            Me.m_ZELEV = value
        End Set
    End Property
    Property ZHILL() As Double
        Get
            Return Me.m_ZHILL
        End Get
        Set(ByVal value As Double)
            Me.m_ZHILL = value
        End Set
    End Property
    Property ZFLAG() As Double
        Get
            Return Me.m_ZFLAG
        End Get
        Set(ByVal value As Double)
            Me.m_ZFLAG = value
        End Set
    End Property
    Property Ave() As String
        Get
            Return Me.m_AVE
        End Get
        Set(ByVal value As String)
            Me.m_AVE = value
        End Set
    End Property
    Property GRP() As String
        Get
            Return m_GRP
        End Get
        Set(ByVal value As String)
            Me.m_GRP = value
        End Set
    End Property
    Property DATET() As String
        Get
            Return Me.m_DATET
        End Get
        Set(ByVal value As String)
            Me.m_DATET = value
        End Set
    End Property
    Property NET_ID() As String
        Get
            Return Me.m_NET_ID
        End Get
        Set(ByVal value As String)
            Me.m_NET_ID = value
        End Set
    End Property

    ''' <summary>
    ''' 用于存储读取到的数据
    ''' </summary>
    ''' <value></value>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Property ConcurrentCollection() As List(Of Concurrent)
        Get
            Return Me.m_ConcurrentCollection
        End Get
        Set(ByVal value As List(Of Concurrent))
            Me.m_ConcurrentCollection = value
        End Set
    End Property


    ''' <summary>
    ''' 读取文件，获取数据
    ''' </summary>
    ''' <param name="mFilePath"></param>
    ''' <remarks></remarks>
    Public Sub GetConcurrentData(ByVal mFilePath As String)
        Dim mStr As String = ""
        Try
            FileClose(1)
            FileOpen(1, mFilePath, OpenMode.Input)
            Do Until EOF(1)
                mStr = LineInput(1)
                If Not mStr.Contains("*") And mStr <> "" Then
                    Dim mConcurrent As New Concurrent
                    mConcurrent.X = CDbl(GetString(mStr, 1))
                    mConcurrent.Y = CDbl(GetString(mStr, 2))
                    mConcurrent.CONC = CDbl(GetString(mStr, 3))
                    mConcurrent.ZELEV = CDbl(GetString(mStr, 4))
                    mConcurrent.ZHILL = CDbl(GetString(mStr, 5))
                    mConcurrent.ZFLAG = CDbl(GetString(mStr, 6))
                    mConcurrent.Ave = GetString(mStr, 7)
                    mConcurrent.GRP = GetString(mStr, 8)
                    mConcurrent.DATET = GetString(mStr, 9)
                    mConcurrent.NET_ID = GetString(mStr, 10)
                    ConcurrentCollection.Add(mConcurrent)
                End If
            Loop
            FileClose(1)
        Catch ex As Exception
            MsgBox("读取文件错误，请与作者联系", MsgBoxStyle.OkOnly, "提示")
            FileClose(1)
        End Try
    End Sub

End Class
